<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html lang="en">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>LCOV - lcov.info.p - periphery/contracts/misc/src/periphery/contracts/misc/WrappedTokenGatewayV3.sol</title>
  <link rel="stylesheet" type="text/css" href="../../../../../../../gcov.css">
</head>

<body>

          <table width="100%" border=0 cellspacing=0 cellpadding=0>
            <tr><td class="title">LCOV - code coverage report</td></tr>
            <tr><td class="ruler"><img src="../../../../../../../glass.png" width=3 height=3 alt=""></td></tr>

            <tr>
              <td width="100%">
                <table cellpadding=1 border=0 width="100%">
          <tr>
            <td width="10%" class="headerItem">Current view:</td>
            <td width="10%" class="headerValue"><a href="../../../../../../../index.html">top level</a> - <a href="index.html">periphery/contracts/misc/src/periphery/contracts/misc</a> - WrappedTokenGatewayV3.sol<span style="font-size: 80%;"> (source / <a href="WrappedTokenGatewayV3.sol.func-c.html">functions</a>)</span></td>
            <td width="5%"></td>
            <td width="5%"></td>
            <td width="5%" class="headerCovTableHead">Coverage</td>
            <td width="5%" class="headerCovTableHead" title="Covered + Uncovered code">Total</td>
            <td width="5%" class="headerCovTableHead" title="Exercised code only">Hit</td>
          </tr>
          <tr>
            <td class="headerItem">Test:</td>
            <td class="headerValue">lcov.info.p</td>
            <td></td>
            <td class="headerItem">Lines:</td>
            <td class="headerCovTableEntryHi">100.0&nbsp;%</td>
            <td class="headerCovTableEntry">38</td>
            <td class="headerCovTableEntry">38</td>
          </tr>
          <tr>
            <td class="headerItem">Test Date:</td>
            <td class="headerValue">2024-04-09 14:12:28</td>
            <td></td>
            <td class="headerItem">Functions:</td>
            <td class="headerCovTableEntryHi">100.0&nbsp;%</td>
            <td class="headerCovTableEntry">10</td>
            <td class="headerCovTableEntry">10</td>
          </tr>
          <tr>
            <td></td>
            <td></td>
            <td></td>
            <td class="headerItem">Branches:</td>
            <td class="headerCovTableEntryHi">-</td>
            <td class="headerCovTableEntry">0</td>
            <td class="headerCovTableEntry">0</td>
          </tr>
                  <tr><td><img src="../../../../../../../glass.png" width=3 height=3 alt=""></td></tr>
                </table>
              </td>
            </tr>

            <tr><td class="ruler"><img src="../../../../../../../glass.png" width=3 height=3 alt=""></td></tr>
          </table>

          <table cellpadding=0 cellspacing=0 border=0>
            <tr>
              <td><br></td>
            </tr>
            <tr>
              <td>
<pre class="sourceHeading">             Branch data     Line data    Source code</pre>
<pre class="source">
<span id="L1"><span class="lineNum">       1</span>                 :             : // SPDX-License-Identifier: BUSL-1.1</span>
<span id="L2"><span class="lineNum">       2</span>                 :             : pragma solidity ^0.8.10;</span>
<span id="L3"><span class="lineNum">       3</span>                 :             : </span>
<span id="L4"><span class="lineNum">       4</span>                 :             : import {Ownable} from 'aave-v3-core/contracts/dependencies/openzeppelin/contracts/Ownable.sol';</span>
<span id="L5"><span class="lineNum">       5</span>                 :             : import {IERC20} from 'aave-v3-core/contracts/dependencies/openzeppelin/contracts/IERC20.sol';</span>
<span id="L6"><span class="lineNum">       6</span>                 :             : import {GPv2SafeERC20} from 'aave-v3-core/contracts/dependencies/gnosis/contracts/GPv2SafeERC20.sol';</span>
<span id="L7"><span class="lineNum">       7</span>                 :             : import {IWETH} from 'aave-v3-core/contracts/misc/interfaces/IWETH.sol';</span>
<span id="L8"><span class="lineNum">       8</span>                 :             : import {IPool} from 'aave-v3-core/contracts/interfaces/IPool.sol';</span>
<span id="L9"><span class="lineNum">       9</span>                 :             : import {IAToken} from 'aave-v3-core/contracts/interfaces/IAToken.sol';</span>
<span id="L10"><span class="lineNum">      10</span>                 :             : import {ReserveConfiguration} from 'aave-v3-core/contracts/protocol/libraries/configuration/ReserveConfiguration.sol';</span>
<span id="L11"><span class="lineNum">      11</span>                 :             : import {UserConfiguration} from 'aave-v3-core/contracts/protocol/libraries/configuration/UserConfiguration.sol';</span>
<span id="L12"><span class="lineNum">      12</span>                 :             : import {DataTypes} from 'aave-v3-core/contracts/protocol/libraries/types/DataTypes.sol';</span>
<span id="L13"><span class="lineNum">      13</span>                 :             : import {IWrappedTokenGatewayV3} from './interfaces/IWrappedTokenGatewayV3.sol';</span>
<span id="L14"><span class="lineNum">      14</span>                 :             : import {DataTypesHelper} from '../libraries/DataTypesHelper.sol';</span>
<span id="L15"><span class="lineNum">      15</span>                 :             : </span>
<span id="L16"><span class="lineNum">      16</span>                 :             : /**</span>
<span id="L17"><span class="lineNum">      17</span>                 :             :  * @dev This contract is an upgrade of the WrappedTokenGatewayV3 contract, with immutable pool address.</span>
<span id="L18"><span class="lineNum">      18</span>                 :             :  * This contract keeps the same interface of the deprecated WrappedTokenGatewayV3 contract.</span>
<span id="L19"><span class="lineNum">      19</span>                 :             :  */</span>
<span id="L20"><span class="lineNum">      20</span>                 :             : contract WrappedTokenGatewayV3 is IWrappedTokenGatewayV3, Ownable {</span>
<span id="L21"><span class="lineNum">      21</span>                 :             :   using ReserveConfiguration for DataTypes.ReserveConfigurationMap;</span>
<span id="L22"><span class="lineNum">      22</span>                 :             :   using UserConfiguration for DataTypes.UserConfigurationMap;</span>
<span id="L23"><span class="lineNum">      23</span>                 :             :   using GPv2SafeERC20 for IERC20;</span>
<span id="L24"><span class="lineNum">      24</span>                 :             : </span>
<span id="L25"><span class="lineNum">      25</span>                 :             :   IWETH internal immutable WETH;</span>
<span id="L26"><span class="lineNum">      26</span>                 :             :   IPool internal immutable POOL;</span>
<span id="L27"><span class="lineNum">      27</span>                 :             : </span>
<span id="L28"><span class="lineNum">      28</span>                 :             :   /**</span>
<span id="L29"><span class="lineNum">      29</span>                 :             :    * @dev Sets the WETH address and the PoolAddressesProvider address. Infinite approves pool.</span>
<span id="L30"><span class="lineNum">      30</span>                 :             :    * @param weth Address of the Wrapped Ether contract</span>
<span id="L31"><span class="lineNum">      31</span>                 :             :    * @param owner Address of the owner of this contract</span>
<span id="L32"><span class="lineNum">      32</span>                 :             :    **/</span>
<span id="L33"><span class="lineNum">      33</span>                 :             :   constructor(address weth, address owner, IPool pool) {</span>
<span id="L34"><span class="lineNum">      34</span>                 :             :     WETH = IWETH(weth);</span>
<span id="L35"><span class="lineNum">      35</span>                 :             :     POOL = pool;</span>
<span id="L36"><span class="lineNum">      36</span>                 :             :     transferOwnership(owner);</span>
<span id="L37"><span class="lineNum">      37</span>                 :             :     IWETH(weth).approve(address(pool), type(uint256).max);</span>
<span id="L38"><span class="lineNum">      38</span>                 :             :   }</span>
<span id="L39"><span class="lineNum">      39</span>                 :             : </span>
<span id="L40"><span class="lineNum">      40</span>                 :             :   /**</span>
<span id="L41"><span class="lineNum">      41</span>                 :             :    * @dev deposits WETH into the reserve, using native ETH. A corresponding amount of the overlying asset (aTokens)</span>
<span id="L42"><span class="lineNum">      42</span>                 :             :    * is minted.</span>
<span id="L43"><span class="lineNum">      43</span>                 :             :    * @param onBehalfOf address of the user who will receive the aTokens representing the deposit</span>
<span id="L44"><span class="lineNum">      44</span>                 :             :    * @param referralCode integrators are assigned a referral code and can potentially receive rewards.</span>
<span id="L45"><span class="lineNum">      45</span>                 :             :    **/</span>
<span id="L46"><span class="lineNum">      46</span>                 :<span class="tlaGNC tlaBgGNC">           8 :   function depositETH(address, address onBehalfOf, uint16 referralCode) external payable override {</span></span>
<span id="L47"><span class="lineNum">      47</span>                 :<span class="tlaGNC">          16 :     WETH.deposit{value: msg.value}();</span></span>
<span id="L48"><span class="lineNum">      48</span>                 :<span class="tlaGNC">          16 :     POOL.deposit(address(WETH), msg.value, onBehalfOf, referralCode);</span></span>
<span id="L49"><span class="lineNum">      49</span>                 :             :   }</span>
<span id="L50"><span class="lineNum">      50</span>                 :             : </span>
<span id="L51"><span class="lineNum">      51</span>                 :             :   /**</span>
<span id="L52"><span class="lineNum">      52</span>                 :             :    * @dev withdraws the WETH _reserves of msg.sender.</span>
<span id="L53"><span class="lineNum">      53</span>                 :             :    * @param amount amount of aWETH to withdraw and receive native ETH</span>
<span id="L54"><span class="lineNum">      54</span>                 :             :    * @param to address of the user who will receive native ETH</span>
<span id="L55"><span class="lineNum">      55</span>                 :             :    */</span>
<span id="L56"><span class="lineNum">      56</span>                 :<span class="tlaGNC">           2 :   function withdrawETH(address, uint256 amount, address to) external override {</span></span>
<span id="L57"><span class="lineNum">      57</span>                 :<span class="tlaGNC">           6 :     IAToken aWETH = IAToken(POOL.getReserveData(address(WETH)).aTokenAddress);</span></span>
<span id="L58"><span class="lineNum">      58</span>                 :<span class="tlaGNC">           6 :     uint256 userBalance = aWETH.balanceOf(msg.sender);</span></span>
<span id="L59"><span class="lineNum">      59</span>                 :<span class="tlaGNC">           4 :     uint256 amountToWithdraw = amount;</span></span>
<span id="L60"><span class="lineNum">      60</span>                 :             : </span>
<span id="L61"><span class="lineNum">      61</span>                 :             :     // if amount is equal to uint(-1), the user wants to redeem everything</span>
<span id="L62"><span class="lineNum">      62</span>                 :<span class="tlaGNC">           4 :     if (amount == type(uint256).max) {</span></span>
<span id="L63"><span class="lineNum">      63</span>                 :<span class="tlaGNC">           2 :       amountToWithdraw = userBalance;</span></span>
<span id="L64"><span class="lineNum">      64</span>                 :             :     }</span>
<span id="L65"><span class="lineNum">      65</span>                 :<span class="tlaGNC">           4 :     aWETH.transferFrom(msg.sender, address(this), amountToWithdraw);</span></span>
<span id="L66"><span class="lineNum">      66</span>                 :<span class="tlaGNC">           4 :     POOL.withdraw(address(WETH), amountToWithdraw, address(this));</span></span>
<span id="L67"><span class="lineNum">      67</span>                 :<span class="tlaGNC">           4 :     WETH.withdraw(amountToWithdraw);</span></span>
<span id="L68"><span class="lineNum">      68</span>                 :<span class="tlaGNC">           4 :     _safeTransferETH(to, amountToWithdraw);</span></span>
<span id="L69"><span class="lineNum">      69</span>                 :             :   }</span>
<span id="L70"><span class="lineNum">      70</span>                 :             : </span>
<span id="L71"><span class="lineNum">      71</span>                 :             :   /**</span>
<span id="L72"><span class="lineNum">      72</span>                 :             :    * @dev repays a borrow on the WETH reserve, for the specified amount (or for the whole amount, if uint256(-1) is specified).</span>
<span id="L73"><span class="lineNum">      73</span>                 :             :    * @param amount the amount to repay, or uint256(-1) if the user wants to repay everything</span>
<span id="L74"><span class="lineNum">      74</span>                 :             :    * @param rateMode the rate mode to repay</span>
<span id="L75"><span class="lineNum">      75</span>                 :             :    * @param onBehalfOf the address for which msg.sender is repaying</span>
<span id="L76"><span class="lineNum">      76</span>                 :             :    */</span>
<span id="L77"><span class="lineNum">      77</span>                 :<span class="tlaGNC">           5 :   function repayETH(</span></span>
<span id="L78"><span class="lineNum">      78</span>                 :             :     address,</span>
<span id="L79"><span class="lineNum">      79</span>                 :             :     uint256 amount,</span>
<span id="L80"><span class="lineNum">      80</span>                 :             :     uint256 rateMode,</span>
<span id="L81"><span class="lineNum">      81</span>                 :             :     address onBehalfOf</span>
<span id="L82"><span class="lineNum">      82</span>                 :             :   ) external payable override {</span>
<span id="L83"><span class="lineNum">      83</span>                 :<span class="tlaGNC">          15 :     (uint256 stableDebt, uint256 variableDebt) = DataTypesHelper.getUserCurrentDebt(</span></span>
<span id="L84"><span class="lineNum">      84</span>                 :             :       onBehalfOf,</span>
<span id="L85"><span class="lineNum">      85</span>                 :             :       POOL.getReserveData(address(WETH))</span>
<span id="L86"><span class="lineNum">      86</span>                 :             :     );</span>
<span id="L87"><span class="lineNum">      87</span>                 :             : </span>
<span id="L88"><span class="lineNum">      88</span>                 :<span class="tlaGNC">          15 :     uint256 paybackAmount = DataTypes.InterestRateMode(rateMode) ==</span></span>
<span id="L89"><span class="lineNum">      89</span>                 :             :       DataTypes.InterestRateMode.STABLE</span>
<span id="L90"><span class="lineNum">      90</span>                 :             :       ? stableDebt</span>
<span id="L91"><span class="lineNum">      91</span>                 :             :       : variableDebt;</span>
<span id="L92"><span class="lineNum">      92</span>                 :             : </span>
<span id="L93"><span class="lineNum">      93</span>                 :<span class="tlaGNC">          10 :     if (amount &lt; paybackAmount) {</span></span>
<span id="L94"><span class="lineNum">      94</span>                 :<span class="tlaGNC">           4 :       paybackAmount = amount;</span></span>
<span id="L95"><span class="lineNum">      95</span>                 :             :     }</span>
<span id="L96"><span class="lineNum">      96</span>                 :<span class="tlaGNC">          10 :     require(msg.value &gt;= paybackAmount, 'msg.value is less than repayment amount');</span></span>
<span id="L97"><span class="lineNum">      97</span>                 :<span class="tlaGNC">          10 :     WETH.deposit{value: paybackAmount}();</span></span>
<span id="L98"><span class="lineNum">      98</span>                 :<span class="tlaGNC">          10 :     POOL.repay(address(WETH), paybackAmount, rateMode, onBehalfOf);</span></span>
<span id="L99"><span class="lineNum">      99</span>                 :             : </span>
<span id="L100"><span class="lineNum">     100</span>                 :             :     // refund remaining dust eth</span>
<span id="L101"><span class="lineNum">     101</span>                 :<span class="tlaGNC">          11 :     if (msg.value &gt; paybackAmount) _safeTransferETH(msg.sender, msg.value - paybackAmount);</span></span>
<span id="L102"><span class="lineNum">     102</span>                 :             :   }</span>
<span id="L103"><span class="lineNum">     103</span>                 :             : </span>
<span id="L104"><span class="lineNum">     104</span>                 :             :   /**</span>
<span id="L105"><span class="lineNum">     105</span>                 :             :    * @dev borrow WETH, unwraps to ETH and send both the ETH and DebtTokens to msg.sender, via `approveDelegation` and onBehalf argument in `Pool.borrow`.</span>
<span id="L106"><span class="lineNum">     106</span>                 :             :    * @param amount the amount of ETH to borrow</span>
<span id="L107"><span class="lineNum">     107</span>                 :             :    * @param interestRateMode the interest rate mode</span>
<span id="L108"><span class="lineNum">     108</span>                 :             :    * @param referralCode integrators are assigned a referral code and can potentially receive rewards</span>
<span id="L109"><span class="lineNum">     109</span>                 :             :    */</span>
<span id="L110"><span class="lineNum">     110</span>                 :<span class="tlaGNC">           1 :   function borrowETH(</span></span>
<span id="L111"><span class="lineNum">     111</span>                 :             :     address,</span>
<span id="L112"><span class="lineNum">     112</span>                 :             :     uint256 amount,</span>
<span id="L113"><span class="lineNum">     113</span>                 :             :     uint256 interestRateMode,</span>
<span id="L114"><span class="lineNum">     114</span>                 :             :     uint16 referralCode</span>
<span id="L115"><span class="lineNum">     115</span>                 :             :   ) external override {</span>
<span id="L116"><span class="lineNum">     116</span>                 :<span class="tlaGNC">           2 :     POOL.borrow(address(WETH), amount, interestRateMode, referralCode, msg.sender);</span></span>
<span id="L117"><span class="lineNum">     117</span>                 :<span class="tlaGNC">           2 :     WETH.withdraw(amount);</span></span>
<span id="L118"><span class="lineNum">     118</span>                 :<span class="tlaGNC">           2 :     _safeTransferETH(msg.sender, amount);</span></span>
<span id="L119"><span class="lineNum">     119</span>                 :             :   }</span>
<span id="L120"><span class="lineNum">     120</span>                 :             : </span>
<span id="L121"><span class="lineNum">     121</span>                 :             :   /**</span>
<span id="L122"><span class="lineNum">     122</span>                 :             :    * @dev withdraws the WETH _reserves of msg.sender.</span>
<span id="L123"><span class="lineNum">     123</span>                 :             :    * @param amount amount of aWETH to withdraw and receive native ETH</span>
<span id="L124"><span class="lineNum">     124</span>                 :             :    * @param to address of the user who will receive native ETH</span>
<span id="L125"><span class="lineNum">     125</span>                 :             :    * @param deadline validity deadline of permit and so depositWithPermit signature</span>
<span id="L126"><span class="lineNum">     126</span>                 :             :    * @param permitV V parameter of ERC712 permit sig</span>
<span id="L127"><span class="lineNum">     127</span>                 :             :    * @param permitR R parameter of ERC712 permit sig</span>
<span id="L128"><span class="lineNum">     128</span>                 :             :    * @param permitS S parameter of ERC712 permit sig</span>
<span id="L129"><span class="lineNum">     129</span>                 :             :    */</span>
<span id="L130"><span class="lineNum">     130</span>                 :<span class="tlaGNC">           2 :   function withdrawETHWithPermit(</span></span>
<span id="L131"><span class="lineNum">     131</span>                 :             :     address,</span>
<span id="L132"><span class="lineNum">     132</span>                 :             :     uint256 amount,</span>
<span id="L133"><span class="lineNum">     133</span>                 :             :     address to,</span>
<span id="L134"><span class="lineNum">     134</span>                 :             :     uint256 deadline,</span>
<span id="L135"><span class="lineNum">     135</span>                 :             :     uint8 permitV,</span>
<span id="L136"><span class="lineNum">     136</span>                 :             :     bytes32 permitR,</span>
<span id="L137"><span class="lineNum">     137</span>                 :             :     bytes32 permitS</span>
<span id="L138"><span class="lineNum">     138</span>                 :             :   ) external override {</span>
<span id="L139"><span class="lineNum">     139</span>                 :<span class="tlaGNC">           6 :     IAToken aWETH = IAToken(POOL.getReserveData(address(WETH)).aTokenAddress);</span></span>
<span id="L140"><span class="lineNum">     140</span>                 :<span class="tlaGNC">           6 :     uint256 userBalance = aWETH.balanceOf(msg.sender);</span></span>
<span id="L141"><span class="lineNum">     141</span>                 :<span class="tlaGNC">           4 :     uint256 amountToWithdraw = amount;</span></span>
<span id="L142"><span class="lineNum">     142</span>                 :             : </span>
<span id="L143"><span class="lineNum">     143</span>                 :             :     // if amount is equal to type(uint256).max, the user wants to redeem everything</span>
<span id="L144"><span class="lineNum">     144</span>                 :<span class="tlaGNC">           4 :     if (amount == type(uint256).max) {</span></span>
<span id="L145"><span class="lineNum">     145</span>                 :<span class="tlaGNC">           2 :       amountToWithdraw = userBalance;</span></span>
<span id="L146"><span class="lineNum">     146</span>                 :             :     }</span>
<span id="L147"><span class="lineNum">     147</span>                 :             :     // permit `amount` rather than `amountToWithdraw` to make it easier for front-ends and integrators</span>
<span id="L148"><span class="lineNum">     148</span>                 :<span class="tlaGNC">           4 :     aWETH.permit(msg.sender, address(this), amount, deadline, permitV, permitR, permitS);</span></span>
<span id="L149"><span class="lineNum">     149</span>                 :<span class="tlaGNC">           4 :     aWETH.transferFrom(msg.sender, address(this), amountToWithdraw);</span></span>
<span id="L150"><span class="lineNum">     150</span>                 :<span class="tlaGNC">           4 :     POOL.withdraw(address(WETH), amountToWithdraw, address(this));</span></span>
<span id="L151"><span class="lineNum">     151</span>                 :<span class="tlaGNC">           4 :     WETH.withdraw(amountToWithdraw);</span></span>
<span id="L152"><span class="lineNum">     152</span>                 :<span class="tlaGNC">           4 :     _safeTransferETH(to, amountToWithdraw);</span></span>
<span id="L153"><span class="lineNum">     153</span>                 :             :   }</span>
<span id="L154"><span class="lineNum">     154</span>                 :             : </span>
<span id="L155"><span class="lineNum">     155</span>                 :             :   /**</span>
<span id="L156"><span class="lineNum">     156</span>                 :             :    * @dev transfer ETH to an address, revert if it fails.</span>
<span id="L157"><span class="lineNum">     157</span>                 :             :    * @param to recipient of the transfer</span>
<span id="L158"><span class="lineNum">     158</span>                 :             :    * @param value the amount to send</span>
<span id="L159"><span class="lineNum">     159</span>                 :             :    */</span>
<span id="L160"><span class="lineNum">     160</span>                 :<span class="tlaGNC">           7 :   function _safeTransferETH(address to, uint256 value) internal {</span></span>
<span id="L161"><span class="lineNum">     161</span>                 :<span class="tlaGNC">          21 :     (bool success, ) = to.call{value: value}(new bytes(0));</span></span>
<span id="L162"><span class="lineNum">     162</span>                 :<span class="tlaGNC">          14 :     require(success, 'ETH_TRANSFER_FAILED');</span></span>
<span id="L163"><span class="lineNum">     163</span>                 :             :   }</span>
<span id="L164"><span class="lineNum">     164</span>                 :             : </span>
<span id="L165"><span class="lineNum">     165</span>                 :             :   /**</span>
<span id="L166"><span class="lineNum">     166</span>                 :             :    * @dev transfer ERC20 from the utility contract, for ERC20 recovery in case of stuck tokens due</span>
<span id="L167"><span class="lineNum">     167</span>                 :             :    * direct transfers to the contract address.</span>
<span id="L168"><span class="lineNum">     168</span>                 :             :    * @param token token to transfer</span>
<span id="L169"><span class="lineNum">     169</span>                 :             :    * @param to recipient of the transfer</span>
<span id="L170"><span class="lineNum">     170</span>                 :             :    * @param amount amount to send</span>
<span id="L171"><span class="lineNum">     171</span>                 :             :    */</span>
<span id="L172"><span class="lineNum">     172</span>                 :<span class="tlaGNC">           1 :   function emergencyTokenTransfer(address token, address to, uint256 amount) external onlyOwner {</span></span>
<span id="L173"><span class="lineNum">     173</span>                 :<span class="tlaGNC">           2 :     IERC20(token).safeTransfer(to, amount);</span></span>
<span id="L174"><span class="lineNum">     174</span>                 :             :   }</span>
<span id="L175"><span class="lineNum">     175</span>                 :             : </span>
<span id="L176"><span class="lineNum">     176</span>                 :             :   /**</span>
<span id="L177"><span class="lineNum">     177</span>                 :             :    * @dev transfer native Ether from the utility contract, for native Ether recovery in case of stuck Ether</span>
<span id="L178"><span class="lineNum">     178</span>                 :             :    * due to selfdestructs or ether transfers to the pre-computed contract address before deployment.</span>
<span id="L179"><span class="lineNum">     179</span>                 :             :    * @param to recipient of the transfer</span>
<span id="L180"><span class="lineNum">     180</span>                 :             :    * @param amount amount to send</span>
<span id="L181"><span class="lineNum">     181</span>                 :             :    */</span>
<span id="L182"><span class="lineNum">     182</span>                 :<span class="tlaGNC">           1 :   function emergencyEtherTransfer(address to, uint256 amount) external onlyOwner {</span></span>
<span id="L183"><span class="lineNum">     183</span>                 :<span class="tlaGNC">           2 :     _safeTransferETH(to, amount);</span></span>
<span id="L184"><span class="lineNum">     184</span>                 :             :   }</span>
<span id="L185"><span class="lineNum">     185</span>                 :             : </span>
<span id="L186"><span class="lineNum">     186</span>                 :             :   /**</span>
<span id="L187"><span class="lineNum">     187</span>                 :             :    * @dev Get WETH address used by WrappedTokenGatewayV3</span>
<span id="L188"><span class="lineNum">     188</span>                 :             :    */</span>
<span id="L189"><span class="lineNum">     189</span>                 :<span class="tlaGNC">           1 :   function getWETHAddress() external view returns (address) {</span></span>
<span id="L190"><span class="lineNum">     190</span>                 :<span class="tlaGNC">           3 :     return address(WETH);</span></span>
<span id="L191"><span class="lineNum">     191</span>                 :             :   }</span>
<span id="L192"><span class="lineNum">     192</span>                 :             : </span>
<span id="L193"><span class="lineNum">     193</span>                 :             :   /**</span>
<span id="L194"><span class="lineNum">     194</span>                 :             :    * @dev Only WETH contract is allowed to transfer ETH here. Prevent other addresses to send Ether to this contract.</span>
<span id="L195"><span class="lineNum">     195</span>                 :             :    */</span>
<span id="L196"><span class="lineNum">     196</span>                 :             :   receive() external payable {</span>
<span id="L197"><span class="lineNum">     197</span>                 :             :     require(msg.sender == address(WETH), 'Receive not allowed');</span>
<span id="L198"><span class="lineNum">     198</span>                 :             :   }</span>
<span id="L199"><span class="lineNum">     199</span>                 :             : </span>
<span id="L200"><span class="lineNum">     200</span>                 :             :   /**</span>
<span id="L201"><span class="lineNum">     201</span>                 :             :    * @dev Revert fallback calls</span>
<span id="L202"><span class="lineNum">     202</span>                 :             :    */</span>
<span id="L203"><span class="lineNum">     203</span>                 :<span class="tlaGNC">           2 :   fallback() external payable {</span></span>
<span id="L204"><span class="lineNum">     204</span>                 :<span class="tlaGNC">           4 :     revert('Fallback not allowed');</span></span>
<span id="L205"><span class="lineNum">     205</span>                 :             :   }</span>
<span id="L206"><span class="lineNum">     206</span>                 :             : }</span>
        </pre>
              </td>
            </tr>
          </table>
          <br>

          <table width="100%" border=0 cellspacing=0 cellpadding=0>
            <tr><td class="ruler"><img src="../../../../../../../glass.png" width=3 height=3 alt=""></td></tr>
            <tr><td class="versionInfo">Generated by: <a href="https://github.com//linux-test-project/lcov" target="_parent">LCOV version 2.0-1</a></td></tr>
          </table>
          <br>

</body>
</html>
